// main.c -- Defines the C-code kernel entry point, calls initialisation routines.

#include "common.h"
#include "scrn.h"
#include "descriptor_tables.h"
#include "timer.h"
#include "page.h"
#include "kheap.h"

int main(struct multiboot *mboot_ptr)
{
    init_video();
    puts("Video Init\n");
    init_descriptor_tables();
    puts("GDT&IDT installed\n");
    
    u32int a = kmalloc(8);
    initialize_paging();
    puts("PAGE initialized\n");
    u32int b = kmalloc_a(8);

    puts("a:");
    puts_hex(a);
    puts(",  b");
    puts_hex(b); 
       
    *(char*)a = 'B';
    *(char*)b = 'A';
    
    kfree(b);
    u32int c = kmalloc_a(8);
    
    puts(",  c");
    puts_hex(c); 
    
    return 0;
}
